package com.ruoyi.stock.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.stock.mapper.StockConfigMapper;
import com.ruoyi.stock.domain.StockConfig;
import com.ruoyi.stock.service.IStockConfigService;

/**
 * 基本配置Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-01-07
 */
@Service
public class StockConfigServiceImpl implements IStockConfigService 
{
    @Autowired
    private StockConfigMapper stockConfigMapper;

    /**
     * 查询基本配置
     * 
     * @param id 基本配置主键
     * @return 基本配置
     */
    @Override
    public StockConfig selectStockConfigById(Long id)
    {
        return stockConfigMapper.selectStockConfigById(id);
    }

    /**
     * 查询基本配置列表
     * 
     * @param stockConfig 基本配置
     * @return 基本配置
     */
    @Override
    public List<StockConfig> selectStockConfigList(StockConfig stockConfig)
    {
        return stockConfigMapper.selectStockConfigList(stockConfig);
    }

    /**
     * 新增基本配置
     * 
     * @param stockConfig 基本配置
     * @return 结果
     */
    @Override
    public int insertStockConfig(StockConfig stockConfig)
    {
        stockConfig.setCreateTime(DateUtils.getNowDate());
        return stockConfigMapper.insertStockConfig(stockConfig);
    }

    /**
     * 修改基本配置
     * 
     * @param stockConfig 基本配置
     * @return 结果
     */
    @Override
    public int updateStockConfig(StockConfig stockConfig)
    {
        stockConfig.setUpdateTime(DateUtils.getNowDate());
        return stockConfigMapper.updateStockConfig(stockConfig);
    }

    /**
     * 批量删除基本配置
     * 
     * @param ids 需要删除的基本配置主键
     * @return 结果
     */
    @Override
    public int deleteStockConfigByIds(Long[] ids)
    {
        return stockConfigMapper.deleteStockConfigByIds(ids);
    }

    /**
     * 删除基本配置信息
     * 
     * @param id 基本配置主键
     * @return 结果
     */
    @Override
    public int deleteStockConfigById(Long id)
    {
        return stockConfigMapper.deleteStockConfigById(id);
    }
}
